#!/bin/bash
#可以连接外网时执行此文件
yum install -y wget
mv /etc/yum.repos.d/CentOS-Base.repo{,.bak}
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
sed -i '/aliyuncs.com/d' /etc/yum.repos.d/*.repo
# cd /etc/yum.repos.d/
# wget https://download.opensuse.org/repositories/filesystems:snapper/CentOS_7/filesystems:snapper.repo
# yum install snapper -y
yum clean all
yum makecache
systemctl stop firewalld
systemctl disable firewalld
systemctl stop NetworkManager
systemctl disable NetworkManager
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
setenforce 0
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime


yum -y update
yum -y install wget uuid git vim net-tools bash-completion ntpdate expect chrony
##OpenStack tools 安装
yum install -y centos-release-openstack-pike
yum install -y python-openstackclient openstack-selinux python2-PyMySQL openstack-utils

#设置时间同步


systemctl enable chronyd
systemctl start chronyd

git clone https://gitee.com/antony-liu/openstack-deploy

reboot
